<template>
  <el-form ref="refFrom" label-position="top" class="padding">
    <el-row>

      <el-col :span="6">
        <el-form-item label="酒店名称">
          {{ currentItem.vendorName }}
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="酒店所属区域"> {{ currentItem.regionName }}</el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="房号位置">
          {{ currentItem.room }}{{ $common.marchType(currentItem.roomPosition, dict.room_position) }}
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="设备编码"> {{ currentItem.deviceId }} </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="6">
        <el-form-item label="订单号">
          {{ currentItem.orderId }}
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="订单类型">
          {{ $common.marchType(currentItem.orderType, dict.order_type) }}
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="时长(秒)">
          {{ currentItem.chooseTime }}
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="订单状态">
          <dict-tag :options="dict.order_status" :value="currentItem.status" />
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :span="6">
        <el-form-item label="openID">
          {{ currentItem.openid }}
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="应付金额(元)">
          {{ currentItem.totalOrderAmount / 100 }}
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="实付金额(元)">
          {{ currentItem.totalOrderActualPayment / 100 }}
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="支付平台">
          <dict-tag :options="platforms" :value="currentItem.platform" />

          <!-- {{ currentItem.platform }} -->
        </el-form-item>
      </el-col>

    </el-row>
    <el-row>
      <el-col :span="6">
        <el-form-item label="支付时间">
          {{ currentItem.payTime }}
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="开始时间">
          {{ currentItem.openTime }}
        </el-form-item>
      </el-col>
      <el-col :span="6">
        <el-form-item label="结束时间">
          {{ currentItem.closeTime }}
        </el-form-item>
      </el-col>

      <el-col :span="6">
        <el-form-item label="剩余时长(秒)"> {{ currentItem.remainTime }} </el-form-item>
      </el-col>

      <!-- <el-col :span="6">
        <el-form-item label="设备类型"> {{ currentItem.deviceType }} </el-form-item>
      </el-col>
      -->
    </el-row>
  </el-form>
</template>

<script lang="ts">
import RefundSet from '@/views/operation/order/common/refund-set/index.vue';
export default {
  mounted() {
    const { proxy } = getCurrentInstance() as ComponentInternalInstance;
    this.proxy = proxy;

    this.dict = toRefs<any>(this.proxy?.useDict('room_position', 'order_status', 'order_type', 'platform'));

    this.init();
  },
  props: {
    data: {}
  },
  data() {
    return {
      dict: {},
      proxy: null,
      showSlider: false,
      currentItem: {},
      platforms: [
        { label: "微信", value: "wxpay" },
        { label: "支付宝", value: "zfbpay" },
      ]
    };
  },
  created() { },
  methods: {
    init(data) {
      if (data == null) data = this.data;
      this.currentItem = JSON.parse(JSON.stringify(data));
    },

    cancel() { }
  }
};
</script>

<style scoped>
.padding {
  padding: 0px;
}
</style>
